﻿using System;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;

namespace MT.Models.Migrations
{
    public partial class db16 : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "CustomerGoodsRecord");

            migrationBuilder.CreateTable(
                name: "MedicalConsume",
                columns: table => new
                {
                    Id = table.Column<int>(nullable: false)
                        .Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
                    CustomerId = table.Column<int>(nullable: false),
                    UseNo = table.Column<string>(unicode: false, maxLength: 50, nullable: true),
                    ConsumeChannelType = table.Column<byte>(nullable: false),
                    StoreId = table.Column<int>(nullable: false),
                    CreateTime = table.Column<DateTime>(type: "datetime", nullable: false, defaultValueSql: "(getdate())"),
                    CreateUserId = table.Column<int>(nullable: false),
                    UpdateTime = table.Column<DateTime>(type: "datetime", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_MedicalConsume", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "MedicalConsumeDetail",
                columns: table => new
                {
                    Id = table.Column<int>(nullable: false)
                        .Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
                    MedicalConsumeId = table.Column<int>(nullable: false),
                    GoodsId = table.Column<int>(nullable: false),
                    Number = table.Column<int>(nullable: false),
                    NeedConsentImage = table.Column<string>(nullable: true),
                    DoctorIds = table.Column<string>(nullable: true),
                    ProjectStaffingData = table.Column<string>(nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_MedicalConsumeDetail", x => x.Id);
                });
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "MedicalConsume");

            migrationBuilder.DropTable(
                name: "MedicalConsumeDetail");

            migrationBuilder.CreateTable(
                name: "CustomerGoodsRecord",
                columns: table => new
                {
                    Id = table.Column<int>(nullable: false)
                        .Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
                    ConsumeChannelType = table.Column<byte>(nullable: false),
                    CreateTime = table.Column<DateTime>(type: "datetime", nullable: false, defaultValueSql: "(getdate())"),
                    CreateUserId = table.Column<int>(nullable: false),
                    CustomerId = table.Column<int>(nullable: false),
                    DoctorIds = table.Column<string>(unicode: false, maxLength: 50, nullable: true),
                    GoodsId = table.Column<int>(nullable: false),
                    NeedConsentImage = table.Column<string>(unicode: false, maxLength: 200, nullable: false),
                    Number = table.Column<int>(nullable: false),
                    ProjectStaffingData = table.Column<string>(maxLength: 500, nullable: true),
                    StoreId = table.Column<int>(nullable: false),
                    UpdateTime = table.Column<DateTime>(type: "datetime", nullable: true),
                    UseNo = table.Column<string>(unicode: false, maxLength: 50, nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_CustomerGoodsRecord", x => x.Id);
                });
        }
    }
}
